package com.secf.service.action.hpy.hys.ListDir;

import java.util.Arrays;

/**
 * @Author ms
 * @Date 2024-07-31 11:26
 */
public class Test10 {
    public static void main(String[] args) {
        int[] data = {10, 20, 5, 1};
        System.out.println("原始数组: " + Arrays.toString(data));
        Arrays.sort(data);
        System.out.println("排序后的数组: " + Arrays.toString(data));
        int searchResult = Arrays.binarySearch(data, 20);
        System.out.println("元素 20 的索引: " + searchResult);
    }
}
